//Singleton
var Utils = new function()
{
	this.readFile = function(filename)
	{
		return $.ajax( {
			url : filename,
			async : false
		}).responseText;
	}
}

//Singleton
var View = new function()
{
	this.TemplatesCache = new Array();

	this.Init = function()
	{
	}

	this.Display = function(template, dataObject)
	{
		if (this.TemplatesCache[template] == undefined)
			this.TemplatesCache[template] = Utils.readFile("js/templates/"
					+ template + ".txt");
		if (dataObject == null)
			dataObject = new Object();
		return RND(this.TemplatesCache[template], dataObject);
	}
}
